package week9.homework;
import java.util.Scanner;
public class pp11_1 {
    public static void main(String[] args) throws StringTooLongException {
        int an=0;
        Scanner scanner = new Scanner(System.in);
        StringTooLongException problem = new StringTooLongException("Input the length of character string out of range.");
        System.out.println("请输入start");


           while(!scanner.hasNext("DONE"))
           {
               System.out.println("请输入不超过20个字符的字符串");
           String a=scanner.nextLine();
           if (a.length()>20)
               throw problem;

           }


        }

}
